import {
	getAction,
	postAction,
	httpAction,
	deleteAction
} from "@/api/manage";
const state = {
	billInfo: {},
	flightInfo: {},
	chargeAssuranceList: []
}

const actions = {
	// 获取业务域和系统数据
	async getChargeAssuranceList({
		commit
	}, params) {
		let {
			data
		} = await getAction('/system/item/all')
		commit("GETChargeAssuranceList", data);
	},
}

const mutations = {
	// 航班数据
	GETFLIGHTINFO(state, params) {
		state.flightInfo = params
	},
	// 签单数据
	GETBILLINFO(state, params) {
		state.billInfo = params
	},
	GETChargeAssuranceList(state, data) {
		state.chargeAssuranceList = data
	},
}

const getters = {
	FlightInfo: (state) => {
		return state.flightInfo || {}
	},
	BillInfo: (state) => {
		return state.billInfo || {}
	},
	ChargeAssuranceList: (state) => {
		return state.chargeAssuranceList || {}
	},
}
export default {
	state,
	actions,
	mutations,
	getters,
};